import "../css/Userlist.css";
import zhCN from "antd/lib/locale/zh_CN";
import React, { useEffect, useState } from "react";
import { Table, ConfigProvider } from "antd";
import axios from "axios";
import "../mock/Echarts/data3";

const Userlist = () => {
  useEffect(() => {
    axios.get("/userlist", { dataType: "json" }).then((res) => {
      let col = res.data.data.columns;
      let data = res.data.data.data;
      setColums(col);
      setData(data);
    });
  }, []);
  let [columns, setColums] = useState([]);
  let [data, setData] = useState([]);

  return (
    <div className="tableBox">
      <ConfigProvider locale={zhCN}>
        <Table
          className="table1"
          columns={columns}
          dataSource={data}
          size="small"
          pagination={{
            size: "small",
            total: 12,
            position: ["bottomCenter"],
            showQuickJumper: true,
          }}
        />
      </ConfigProvider>
    </div>
  );
};
export default Userlist;
